package com.tianhao.autoconfigure.shardingsphere;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.LongValue;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * @author tianhao.luo@hand-china.com
 * @version 1.0
 * @date 2022年02月13日 星期日 2:29 下午
 * @description
 * @since 1.0
 */
@Configuration
@ComponentScan(basePackages = {"com.tianhao"})
public class MybatisMapperAutoConfiguration {

    /**
     * @description 配置mapper扫描
     * @since 1.0
     * @version 1.0
     * @author tianhao.luo@hand-china.com
     * @date 2022/2/13 2:32 下午
     * @return
     */
    @Bean
    @Primary
    public MapperScannerConfigurer mapperScannerConfigurer() {
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setBasePackage("*.**.mapper");
        return mapperScannerConfigurer;
    }
}
